/*
 * IEATDashboard.java
 *
 * Created on October 5, 2011, 3:03 PM
 */
 
package eu.games.esmi.ieat;           

import com.vaadin.Application;
import com.vaadin.ui.*;
import com.vaadin.ui.themes.Reindeer;
import eu.games.esmi.ieat.indicatorrelations.MainIndicatorRelations;
import eu.games.esmi.ieat.indicatorvalues.MainIndicatorValues;
/** 
 *
 * @author user
 * @version 
 */

public class IEATDashboard extends Application {

    private Accordion sections;
    private MainIndicatorValues mainIndicatorValues = new MainIndicatorValues();
    private MainIndicatorRelations mainIndicatorRelations = new MainIndicatorRelations();
    
    @Override
    public void init() {
        this.setTheme("games");
	Window mainWindow = new Window("IEATDashboard");
        mainWindow.setContent(new VerticalLayout());
        mainWindow.getContent().setSizeFull();
        ((Layout)mainWindow.getContent()).setMargin(true);
        //mainWindow.getContent().setHeight("1000px");
        //VerticalLayout mainContent = new VerticalLayout();
        //mainContent.setSpacing(true);
        
        Label title = new Label("<h1>Integrated Energy Assessment Tool</h1>");
        title.setContentMode(Label.CONTENT_XHTML);
        title.setStyleName("title");
        mainWindow.addComponent(title);
        
        sections = new Accordion();
        
        sections.setStyleName("v-section");
        //sections.setSizeFull();
        mainIndicatorValues.setSizeFull();
        mainIndicatorRelations.setSizeFull();
        
        Panel p1 = new Panel();
        p1.setSizeFull();
        p1.addComponent(mainIndicatorValues);
        Panel p2 = new Panel();
        p2.setSizeFull();
        p2.addComponent(mainIndicatorRelations);
        
        
        sections.addTab(p1, "Indicator values", null);
        sections.addTab(p2, "Indicator relations", null);

        sections.setSizeFull();
        //sections.setWidth("100%");
        mainWindow.addComponent(sections);
        ((VerticalLayout)mainWindow.getContent()).setExpandRatio(sections, 1.0f);
        
        //mainWindow.addComponent(mainContent);
	setMainWindow(mainWindow);
    }

}
